<template>
  <div class="classics">
    <div class="cla-item" v-for="item in classics" :key="item.id">
      <div>
        <img :src="item.img" alt="" />
      </div>
      <div class="line-ellipsis">
        <p>{{ item.nm }}</p>
        <p>{{ item.enm }}</p>
        <p>{{ item.cat }}</p>
        <p>{{ item.pubDesc }}</p>
      </div>
      <div v-if="item.sc > 0">
        <span class="grade">{{ item.sc }}</span
        ><span>分</span>
      </div>
      <div v-else>暂无评分</div>
    </div>
  </div>
</template>

<script>
import axios from "axios";
export default {
  // eslint-disable-next-line vue/multi-word-component-names
  name: "Wait",
  data() {
    return {
      classics: [],
    };
  },
  mounted() {
    axios.get("./json/jingdian.json").then((res) => {
      console.log(res);
      this.classics = res.data.classicMovies.list;
      console.log(this.classics);
    });
  },
};
</script>

<style lang="less">
.line-ellipsis {
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}
.classics {
  padding-top: 20px;
  padding-bottom: 30px;
}
.cla-item {
  display: flex;
  position: relative;
  margin: 0 0 20px 20px;
  div:nth-child(1) {
    width: 66px;
    height: 94px;
    img {
      width: 100%;
    }
  }
  div:nth-child(2) {
    width: 219px;
    height: 94px;
    margin-left: 10px;
    padding-top: 4px;
    font-size: 13px;
    color: #666;
    line-height: 18px;
    p:nth-child(1) {
      font-size: 17px;
      font-weight: 700;
      color: #333;
    }
    p {
      margin-bottom: 5px;
      display: block;
    }
  }
  div:nth-child(3) {
    color: #999;
    width: 60px;
    font-size: 14px;
    .grade {
      font-size: 16px;
      color: #faaf00;
    }
  }
}
</style>